Rotating hard-disk drives are often used in personal computers (PC's), servers, video recorders, and many other kind of electronic devices for mass storage. Mass storage is used to store large amounts of data that is typically copied to a faster random-access memory such as a dynamic-random-access memory (DRAM) for use by a processor. While the processor's DRAM is randomly accessible, mass storage is block-accessible. An entire block of data must be read or written from the mass storage device. A RAM may allow reading and writing of individual bytes or words of 4 or 8 bytes, while a mass storage device requires that a sector or 512 bytes or more be read or written together.
Flash memory may also be used as a mass storage device in lieu of a hard disk. Flash-memory arrays are also block-accessible, but have a much faster access time than rotating media such as a hard disk. However, since flash memory chips are block-addressable rather than randomly-accessible, flash is not as easy to use for a cache as DRAM or SRAM.
A host generates a logical sector addresses (LSA) of a 512-byte block of data to be read or written from a mass storage device. Flash memory can only be erased a block at a time. A flash memory manager converts LSA logical addresses from a host PC into physical block addresses (PBA) that identify physical blocks of data in the flash memory. The flash memory manager may use re-mapping tables to perform the address translation, and may perform other flash-related functions such as wear-leveling to spread erasures over blocks in flash memory. An erase count may be kept for each block in flash memory, and the block with the lowest erase count is selected to receive new data.
While an entire block has to be erased together, pages within a block could be written and over-written several times. Some older flash memory chips may allow over-writing of pages that have previously been written. Blocks with all stale pages could be erased and re-used. These older flash memories were thus fairly easy to use, especially when over-writing.
Older flash memory chips used electrically-erasable programmable read-only memory (EEPROM) memory cells that stored one bit of data per memory cell. Each cell could be in one of two states. When the floating gate in the flash memory cell was charged with electrons, a higher (more positive) gate voltage is needed to turn on the conducting transistor channel. When the floating gate in the flash memory cell was not charged with electrons, a lower (less positive) gate voltage is needed to turn on the conducting transistor channel.
Newer multi-level-cell (MLC) flash memory use EEPROM memory cells that stored two, four, or more bits of data per memory cell. Different amounts of charge stored on the floating gates produce different current and different sensing voltages for the same memory cell. Thus a single memory cell can store multiple bits of information by assigning different voltages to different logic levels.
Multi-level-cell flash memory can store a higher density than single-level cell flash for the same cell size. Thus multi-level cell flash is likely to be used more frequently for higher-density flash chips made now and in the future.
However, MLC flash chips may impose additional restrictions on usage. For example, a MLC flash chip may not allow pages to be written a second time before erase, such as for number-of-page-programming NOP=1 chips. Instead, the entire block must be erased before any page can be written again. Each page may be written only once after each erase. Alternately, some writing may be allowed, such as writing a 1 bit to a 0 bit, but other writes are not allowed, such as writing a 0 bit to a 1 bit.
Some MLC flash chips may be even more restrictive. Some MLC flash chips may require pages to be written in a sequence within a block. These restrictive MLC chips may prohibit “backwards” writing, but only allow “forward” writing, although some pages may be skipped when writing data in.
Another problem with MLC cells, especially with many states per cell, is that the noise margins are very small. Over time, floating gates can gain or lose charge. Programming or reading adjacent cells may disturb stored charge, or leakage may occur. The restriction on page-write order may help reduce these problems.
While MLC cells with a high number of states per cell are desirable for improved density, the restrictions on page-write ordering make prior-art flash controllers obsolete. Sequencers for restrictive MLC flash memory is desirable.
What is desired is a flash memory manager for restrictive MLC flash memory. A flash memory controller that writes in and re-locates flash blocks to avoid out-of-order page writes is desirable.